import request from '@/services/axios'
/**
 * 候诊屏相关接口
 */
var UserWaitApi = {
    /**
     * 获取全量在线医生列表
     * @param params
     * @returns {AxiosPromise}
     */
    getWaitList: function getWaitList(data) {
        return request.post({
            url: "/api/qcss/sign/waitList",
            data
        });
    },
    /**
     * 获取列表
     * @param params
     * @returns {AxiosPromise}
     */
    getWaitingAll: function getWaitingAll(data) {
        return request.post({
            url: "/api/qcss/sign/getWaitingAll",
            data
        });
    },
    /**
     * 获取全量等候患者
     * @param params
     * @returns {AxiosPromise}
     */
    getFullWaitingAll: function getFullWaitingAll(data) {
        return request.post({
            url: "/api/qcss/sign/getFullWaitingAll",
            data
        });
    },
    /**
     * 查询呼叫记录
     * @param params
     * @returns {AxiosPromise}
     */
    getPatientLog: function getWaitingAll(data) {
        return request.post({
            url: "/api/qcss/stats/patient/screen/log",
            data
        });
    },
    /**
     *  @desc 获取过号数据
     *  @param  data
     *
     */
    getPassList: function getPassList(data) {
        return request.post({
            url: "/api/qcss/triage/overList",
            data
        });
    },
    /**
     *  @desc 获取候诊屏绑定医生
     *  @param  data
     *
     */
    getAllWorkerList: function getAllWorkerList(data) {
        return request.post({
            url: "/api/qcss/sign/waitAllWorkerList",
            data
        });
    }
};

// 诊室屏相关接口
var UserRoomApi = {

    /**
     * 获取诊室屏的登陆医生
     * @param data
     * @returns {*}
     */
    getRoomDocs: (data) => {
        return request.post({
            url: "/api/qcss/sign/waitListByConsulting",
            data
        });
    },

    /**
     *  @desc 获取登陆医生排版信息
     *  @param  data
     *   http://localhost:8080/clinic/api/irms/model/detail?modelId=1745316765213446146
     *  http://localhost:8080/clinic/terminal/common/getScheduleByWorkerIdsAndDateRange?workerIds=12
     * */
    getSchedulingInfo: (params) => {
        return request.get({
            url: '/terminal/common/getScheduleByWorkerIdsAndDateRange',
            params
        });
    },

    /**
     *  @desc 获取诊室屏的患者
     *  @param  data
     * */
    getRoomPatients: (data) => {
        return request.post({
            url: '/api/qcss/sign/getWaiting',
            data
        });
    },
    /**
     *  @desc 获取诊室屏的科室信息
     *  @param  data
     * */
    getRoomDeptInfo: (data) => {
        return request.post({
            url: '/api/qcss/sign/getConsultingScreenWorkerInfo',
            data
        });
    },
    /**
     *  @desc 获取过号数据
     *  @param  data
     *
     */
    getPassData: function getPassList(data) {
        return request.post({
            url: "/api/qcss/triage/overList",
            data
        });
    },
}

/**
 * 抽象的公共方法
 * @type {{commonReqApi: ((function(*, string=, *): (*))|*)}}
 */
var CommonApi={
    /**
     *  @desc 获取过号数据
     *  @param  data
     *
     */
    commonReqApi: function getPassList(url,method = 'post',data) {
        if("post" == method){
            return request.post({
                url: url,
                data
            });
        }else{
            return request.get({
                url: url,
                params:data
            });
        }
    },
}
export {UserWaitApi,UserRoomApi,CommonApi}





